import App from './App'
import {
	toFixedNum,
	toFixedNum2,
	previewImage,
	copy,
	checkStr
} from '_c/utils'
import
config
from '_c/utils/config'
import {
	formDate
} from '_c/utils/date'
import filter from '_c/utils/filter'
import G_show_modal from '@/components/G_show_modal/g_show_modal.js'
import {
	setStore,
	getStore,
	removeStore
} from '_c/utils/store'
import store from './store'
import tip from '_c/utils/tip'
import * as router from '_c/utils/router'
import uview from './components/uview-ui/index.js'
import jsQR from "jsqr"
import * as selectUpload from '_c/utils/chooseImage'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
import downloadjs from 'downloadjs'
let isApp = false

// #ifdef APP-PLUS
isApp = true
// #endif
// #ifdef H5
const userAgent = navigator.userAgent.toLowerCase(); //获取UA信息
let phoneAgent = ''
console.log(userAgent, '浏览器标识');
if (userAgent.includes('android')) {
	phoneAgent = 'android'
} else if (userAgent.includes('ios')) {
	phoneAgent = 'ios'
} else if (userAgent.match(/MicroMessenger/i) == "micromessenger") {
	phoneAgent = 'wechat'
} else {
	phoneAgent = 'other'
}
if (userAgent.includes('uniapp-android') || userAgent.includes('uniapp-ios') || userAgent.includes('html5plus')) {
	isApp = true
}
Vue.prototype.$phoneAgent = phoneAgent
// #endif


Vue.prototype.$isApp = isApp
Vue.prototype.$config = config
Vue.prototype.toFixedNum = toFixedNum
Vue.prototype.toFixedNum2 = toFixedNum2
Vue.prototype.formDate = formDate
Vue.prototype.$downloadjs = downloadjs
Vue.prototype.$selectUpload = selectUpload;
Vue.prototype.$checkStr =checkStr

Vue.prototype.$store = store
Vue.prototype.$storage = {
	setStore,
	getStore,
	removeStore
}
Vue.prototype.$tip = tip;
Vue.prototype.$nav = router;
Vue.prototype.previewImage = previewImage;
Vue.prototype.$copy = copy;
Vue.use(uview);
Vue.use(G_show_modal)


// Vue.prototype.$config = config

const app = new Vue({
	...App
})

app.$mount()
// #endif


// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import {
	logAxis
} from 'echarts/lib/theme/dark'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif